home *** CD-ROM | disk | FTP | other *** search
/ Programmer Plus 2007 / Programmer-Plus-2007.iso / Programming / Compilers / digital marsC compier / dm / include / Disp.h < prev    next >
Encoding:
C/C++ Source or Header  |  2001-03-16  |  3.7 KB  |  145 lines

  1. /* Copyright (C) 1986-2001 by Digital Mars. $Revision: 1.1.1.1 $ */
  2. #if __SC__ || __RCC__
  3. #pragma once
  4. #endif
  5.  
  6.  
  7. #ifndef __DISP_H
  8. #define __DISP_H 1
  9.  
  10. #if __cplusplus
  11. extern "C" {
  12. #endif
  13.  
  14. extern  int
  15.     __cdecl disp_numrows,
  16.     __cdecl disp_numcols,
  17.     __cdecl disp_cursorrow,
  18.     __cdecl disp_cursorcol;
  19. extern short disp_nowrap;  /* does display wrap or not */    
  20.  
  21. extern  int
  22.     __cdecl disp_printf(char *,...),
  23.     __cdecl disp_getmode(void),
  24.     __cdecl disp_getattr(void),
  25.     __cdecl disp_putc(int);
  26. extern  void
  27.     __cdecl disp_levelblockpoke(int,int,int,int,unsigned,unsigned *,unsigned,unsigned *,unsigned),
  28.     __cdecl disp_open(void),
  29.     __cdecl disp_puts(const char *),
  30.     __cdecl disp_box(int,int,unsigned,unsigned,unsigned,unsigned),
  31.     __cdecl disp_close(void),
  32. #ifndef _WINDOWS
  33.     __cdecl disp_usebios(void),
  34. #endif
  35.     __cdecl disp_move(int,int),
  36.     __cdecl disp_flush(void),
  37.     __cdecl disp_eeol(void),
  38.     __cdecl disp_eeop(void),
  39.     __cdecl disp_startstand(void),
  40.     __cdecl disp_endstand(void),
  41.     __cdecl disp_setattr(int),
  42.     __cdecl disp_setcursortype(int),
  43.     __cdecl disp_pokew(int,int,unsigned short),
  44.     __cdecl disp_scroll(int,unsigned,unsigned,unsigned,unsigned,unsigned),
  45.     __cdecl disp_setmode(unsigned char),
  46.     __cdecl disp_peekbox(unsigned short *,unsigned,unsigned,unsigned,unsigned),
  47.     __cdecl disp_pokebox(unsigned short *,unsigned,unsigned,unsigned,unsigned),
  48. #ifndef _WINDOWS
  49.     __cdecl disp_set43(void),
  50.     __cdecl disp_reset43(void),
  51. #endif
  52.     __cdecl disp_fillbox(unsigned,unsigned,unsigned,unsigned,unsigned),
  53.     __cdecl disp_hidecursor(void),
  54.     __cdecl disp_showcursor(void);
  55. extern  unsigned short __cdecl disp_peekw(int,int);
  56.  
  57. /* Globals for IBM PC displays (read only):     */
  58. extern  unsigned char
  59.     __cdecl disp_mono,
  60.     __cdecl disp_mode,
  61.     __cdecl disp_inited,
  62.     __cdecl disp_ega;
  63. extern  unsigned __cdecl disp_base;
  64.  
  65. #if M_UNIX || M_XENIX
  66. extern unsigned char __cdecl disp_scomode, __cdecl disp_captured;
  67. extern int __cdecl disp_vt_number;
  68. extern char __cdecl *disp_offset;
  69. #else
  70. extern  unsigned char __cdecl disp_snowycga;
  71. #endif
  72.  
  73. #define DISP_REVERSEVIDEO       0x70
  74. #define DISP_NORMAL             0x07
  75. #define DISP_UNDERLINE          0x01
  76. #define DISP_NONDISPLAY         0x00
  77.  
  78. #define DISP_INTENSITY          0x08
  79. #define DISP_BLINK              0x80
  80.  
  81. #if _WIN32
  82. #define DISP_CURSORBLOCK    100
  83. #define DISP_CURSORHALF         50
  84. #define DISP_CURSORUL         20
  85. #else
  86. #define DISP_CURSORBLOCK (disp_mono ? 0x000C : 0x0007)
  87. #define DISP_CURSORHALF  (disp_mono ? 0x060C : 0x0307)
  88. #define DISP_CURSORUL    (disp_mono ? 0x0B0C : 0x0707)
  89. #endif
  90.  
  91. #if !(M_UNIX || M_XENIX)
  92. #pragma pack(1)
  93.  
  94. typedef struct disp_t
  95. {
  96.     unsigned numrows;
  97.     unsigned numcols;
  98.     unsigned cursorrow;
  99.     unsigned cursorcol;
  100.     unsigned char mono;
  101.     unsigned char snowycga;
  102.     unsigned char mode;
  103.     unsigned char inited;
  104.     unsigned char ega;
  105.     unsigned char reserved[3];
  106.     short nowrap;
  107.  
  108.     union _disp
  109.     {
  110.     unsigned short __far *base;
  111.     struct _disp1
  112.     {   unsigned offset;
  113.         unsigned short base;
  114.     } _disp1x;
  115.     } _dispx;
  116. #if _WIN32
  117.    void *handle;
  118. #endif
  119. } disp_t;
  120.  
  121. #pragma pack()
  122.  
  123. extern disp_t __cdecl disp_state;
  124.  
  125.  
  126. #define disp_numrows    disp_state.numrows
  127. #define disp_numcols    disp_state.numcols
  128. #define disp_cursorrow  disp_state.cursorrow
  129. #define disp_cursorcol  disp_state.cursorcol
  130. #define disp_mono       disp_state.mono
  131. #define disp_snowycga   disp_state.snowycga
  132. #define disp_mode       disp_state.mode
  133. #define disp_inited     disp_state.inited
  134. #define disp_ega        disp_state.ega
  135. #define disp_nowrap     disp_state.nowrap
  136. #define disp_base       disp_state._dispx._disp1x.base
  137.  
  138. #endif
  139.  
  140. #if __cplusplus
  141. }
  142. #endif
  143.  
  144. #endif
  145.